<?php
namespace app\index\model;

use think\Model;
use traits\model\SoftDelete;

class Carousel extends Model
{
    
    protected $autoWriteTimestamp = true;

    use SoftDelete;

    protected $deleteTime = 'delete_time';
    
    public function findInfo($where,$field = '*') {
        $res = $this->where($where)->field($field)->order('create_time desc')->find();
        return empty($res)?array():$res->toArray();
    }
    
    public function selectInfo($where,$sort = 'create_time desc',$field = '*',$limit = '') {
        $res = $this->where($where)->field($field)->order($sort)->limit($limit)->select();
        return empty($res)?array():$res->toArray();
    }
    
    
}